﻿package framework.core;

import java.util.*;
/**
 * Creation date: (2003-08-28)
 * @author: administrator
 * 系统操作类管理器
 * 功能：
 *		根据ActionCode得到Action对象
 *		Debug.ON=false时提供高速缓存功能
 */
public class ActionManager 
{
	private static HashMap m_actions = new HashMap();
	private static void clear()
	{
		m_actions.clear();
	}
	public static Action getAction(DBConnection con,String action_code) throws Exception
	{
		if(Config.isDebug())
		{
			clear();
		}
		if(m_actions.containsKey(action_code))
		{
			return (Action)m_actions.get(action_code);
		}
		Action action = Action.fetch(con,action_code);
		m_actions.put(action_code,action);
		return action;
	}
}
